package com.zzc.legou.service.item.controller;

import com.zzc.legou.core.controller.BaseController;
import com.zzc.legou.item.entity.Sku;
import com.zzc.legou.service.item.service.ISkuService;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Title:
 */
@RestController
@RequestMapping(value = "/em/sku")
public class SkuController extends BaseController<ISkuService, Sku> {

    @GetMapping("/select-skus-by-spuid/{id}")
    public List<Sku> selectSkusBySpuId(@PathVariable("id") Long spuId) {
        if(ObjectUtils.isEmpty(spuId)){
            return null;
        }
        return service.selectSkusBySpuId(spuId);
    }
}
